package com.clarte.scheduler;

import java.util.Date;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.clarte.model.User;
import com.clarte.user.service.UserService;
import com.clarte.util.SpringUtil;

public class MyJob extends QuartzJobBean {
	private UserService userService;
	public MyJob(){
		userService = SpringUtil.getBean("userService");
	}
	@Override
	protected void executeInternal(JobExecutionContext ctx)
			throws JobExecutionException {
		User user = (User)ctx.getJobDetail().getJobDataMap().get("user");
		System.out.println(new Date()+user.getUsername());
	}

}
